package SinglyLinkedList;

public class TestSinglyLinkedList01 {
  public static void main(String[] args) {
    SinglyLinkedList list1 = new SinglyLinkedList();
    list1.addFirst(1);
    list1.addFirst(2);
    list1.addFirst(3);
    list1.addFirst(4);
    list1.addFirst(5);

    list1.loop1();
    list1.loop2(value -> System.out.println(value));

    System.out.println("----------------------------");

    SinglyLinkedList list2 = new SinglyLinkedList();
    list2.addLast(6);
    list2.addLast(7);
    list2.addLast(8);
    list2.addLast(9);
    list2.addLast(10);

    list2.loop1();
    list2.forIndex();

    System.out.println("----------------------------");

    System.out.println("getValue()  " + list2.getValue(1));
    // System.out.println(list2.getValue(10));

    System.out.println("----------------------------");

    list2.insert(0, 99);
    list2.insert(6, 999);
    list2.forIndex();
  }
}
